package com.allscore.nacos.consumer.controler;

import com.allscore.nacos.consumer.api.User;
import com.allscore.nacos.consumer.fegin.UserFegin;
import com.allscore.nacos.consumer.restTemple.DemoNacosDiscoveryRestTemple;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumeController {

    @Autowired
    private DemoNacosDiscoveryRestTemple demoTemple;

    @Autowired
    private UserFegin userFegin;

    @GetMapping("/user")
    public User instance() {
        return demoTemple.getUser();
    }

    @GetMapping("/findUser")
    public User findUser() {
        return userFegin.getUser();
    }
}
